home *** CD-ROM | disk | FTP | other *** search
- %TITLE "ASSEMBLY MODULE FOR CLIPBOARD INTERACTION by David B. Symolon"
- ;
- ; Clipbrd.h has all the C prototypes for these functions.
- ;
- ;
- ;If a function returns an -int- that means it will return 0 if unsuccessful
- ; a non-zero value if it is - except if otherwise noted!
- ;
- .MODEL small
- .CODE
- PUBLIC _WinOldApp,_OpenClipBoard,_ClearClipBoard,_CopyToClip,_QueryClip,
- PUBLIC _PasteFrmClip,_CloseClip,_CompactClip
-
-
- ;**************** int WinOldApp( void ) *****************************
- ; NOTE: returns version; otherwise returns 1700h if Clip not supported
- ;
- _WinOldApp PROC
- push bp
- mov bp,sp ;Local stack frame
- mov ax,1700h ;function call
- int 2fh ;multiplex interupt
- cmp ax,1700h
- jnz ver
- sub ax,ax ;return 0=FALSE
- ver:
- pop bp
- ret
- _WinOldApp ENDP
-
- ;************* int OpenClipBoard( void ) ****************************
-
- _OpenClipBoard PROC
- mov ax,1701h
- int 2fh
- ret
- _OpenClipBoard ENDP
-
- ;************* int ClearClipBoard( void ) *****************************
-
- _ClearClipBoard PROC
- mov ax,1702h
- int 2fh
- ret
- _ClearClipBoard ENDP
-
- ;************ int CopyToClip( int <format code>,*******************
- ; unsigned long <length of data (bytes), void far*<ptr to data> )
- ;
- ;Format codes:
- ; 1 text - Windows
- ; 2 Bitmap
- ; 3 Metafile
- ; 4 SYLK Excel Format
- ; 5 DIF Standard data interchange
- ; 6 TIFF Tagged image File(graphics)
- ; 7 OEM Text(Using the PC text) -*! use with DOS *
- ; 81H DSP Text TEXT
- ; 82H DSP Bitmap
- ;-------------------------------------------------------------------
- _CopyToClip PROC
- push bp
- mov bp,sp
- push si
- mov ax,1703h
- mov dx,[bp+4] ;format code
- mov si,word ptr[bp+8] ;length of data
- mov cx,word ptr[bp+6]
- les bx,[bp+10] ;pointer to data
- int 2fh ;make the call
- pop si
- pop bp
- ret
- _CopyToClip ENDP
- ;
- ; SEE format codes above...
- ;
- ;******************* *long QueryClip( int <format code> )***********
- ;
- _QueryClip PROC
- push bp
- mov bp,sp
- mov ax,1704h
- mov dx,[bp+4]
- int 2fh
- pop bp
- ret
- _QueryClip ENDP
-
- ;*********** int PasteFrmClip(int <format code>, PVOID <buffer> ) ****
- ;
- _PasteFrmClip PROC
- push bp
- mov bp,sp
- mov ax,1705h
- mov dx,[bp+4]
- les bx,[bp+6]
- int 2fh
- pop bp
- ret
- _PasteFrmClip ENDP
- ;
- ;************* int CloseClip( void )* ******************************
- _CloseClip PROC
- mov ax,1708h
- int 2fh
- _CloseClip ENDP
- ;
- ;************* *long CompactClip( int <required size in bytes> ) ****
- _CompactClip PROC
- push bp
- mov bp,sp
- push ds ; Had to save all the regs
- push es ; Func-1709 messed them all up!
- push ss
- push di
- push si
-
- mov ax,1709h
- mov si,word ptr[bp+6] ; Required size in bytes
- mov cx,word ptr[bp+4] ;
- int 2fh
-
- pop si
- pop di
- pop ss
- pop es
- pop ds
- pop bp
- ret
- _CompactClip ENDP
-
- END